<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>change-to-flex</title>
    <link rel="stylesheet" href="./reset.css">
    <style>
    .block {
        position: relative;
        top: 10px;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        border: 2px solid blue;
        box-sizing: border-box;
    }

    .block:nth-child(1) {
        border: 2px solid green;
        margin-left: auto;
        margin-right: auto;
        /*margin: 30px;*/
    }

    .block:nth-child(2) {
        /*position: static;*/
        /*border-color: red;*/
        /*margin: 20px;*/
        border: 2px solid red;
    }
    </style>
</head>

<body>
    <div class="block">
        A
    </div>
    <div class="block">
        B
    </div>
    <div class="block">
        C
    </div>
    <div class="block">
        D
    </div>
</body>

</html>